﻿using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace IService.Blog
{
    public interface IMenusService
    {
        #region Get

        /// <summary>
        /// 查询所有菜单（分页）
        /// </summary>
        /// <param name="offset">页数</param>
        /// <param name="limit">每页数</param>
        /// <returns></returns>
        public Task<MessageModel<PageInfoModel<BMenu>>> GetAllToPage(int offset = 1, int limit = 15);


        /// <summary>
        /// 按角色ID查询所有菜单
        /// </summary>
        /// <param name="roleID">角色ID</param>
        /// <returns></returns>
        public Task<MessageModel<List<BMenu>>> GetAllToPageByRoleID(int roleID = 1);

        /// <summary>
        /// 查询所有菜单
        /// </summary>
        public Task<MessageModel<List<BMenu>>> GetAll();

        /// <summary>
        /// 根据条件表达式查询数据列表
        /// </summary>
        /// <param name="whereExpression">条件表达式</param>
        /// <returns>数据列表</returns>
        public Task<MessageModel<List<BMenus>>> GetByExpression<BMenus>(Expression<Func<BMenus, bool>> whereExpression);


        /// <summary>
        /// 查询菜单按ID
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Task<MessageModel<BMenu>> GetById(int id);
        #endregion

        #region Post
        /// <summary>
        /// 添加菜单
        /// </summary>
        /// <param name="parameter"></param>
        /// <returns></returns>
        public Task<MessageModel<string>> Post(BMenu parameter);

        #endregion

        #region Put
        /// <summary>
        /// 修改菜单
        /// </summary>
        /// <param name="parameter"></param>
        /// <returns></returns>
        public Task<MessageModel<string>> Put(BMenu parameter);

        #endregion

        #region Delete
        /// <summary>
        /// 删除菜单
        /// </summary>
        /// <param name="parameter"></param>
        /// <returns></returns>
        public Task<MessageModel<bool>> DelById(int id);

        #endregion

    }
}
